﻿using System;
using System.Collections.Generic;

namespace VerticalMenu
{
	public class TableInfos
	{
		public string TableName { get; set; }

		public List<CommandInfos> CommandInfoList { get; set; }

		public TableInfos()
		{
			this.CommandInfoList = new List<CommandInfos>();
		}

		public TableInfos(string tableName, List<CommandInfos> commandInfoList)
		{
			this.TableName = tableName;
			this.CommandInfoList = commandInfoList;
		}

		public TableInfos(TableInfos infos)
		{
			this.TableName = infos.TableName;
			this.CommandInfoList = infos.CommandInfoList;
		}

		public bool GetCmdPanelName(string cmdName, ref string cmdText, ref string panelName)
		{
			foreach (CommandInfos commandInfos in this.CommandInfoList)
			{
				bool flag = commandInfos.CmdName.CompareTo(cmdName) == 0;
				if (flag)
				{
					cmdText = commandInfos.CmdText;
					panelName = commandInfos.PanelName;
					return true;
				}
			}
			return false;
		}
	}
}
